<?php include("include/header.php");
?>
<section id="content">
    <section class="hbox stretch">
        <section>
            <section class="vbox">
                <section class="scrollable padder">
                    <div class="m-b-md">
                      <!--<h3 class="m-b-none">当前绑定帐号：<?= $token_name ?></h3>-->
                    </div>
                    <ul class="breadcrumb m-b-md">
                        <li><a href="index.php?c=main"><i class="fa fa-home"></i> 首页</a></li>
                        <li><a href="index.php?c=manage&m=wechat_list"><i class="fa fa-list-ul"></i> 标签管理</a></li>
                        <li class="active">添加标签</li>
                    </ul>
                    <div class="panel panel-default">
                        <div class="panel-body">

                            <div class="m-b-sm">
                                <iframe id="js_frame" name="js_frame" style="display:none;"></iframe>
                                <!-- shuai20180813修改action的m=wechat_save为type_save -->
                                <form class="form-horizontal" method="post" action="index.php?c=manage&m=type_save" target="js_frame" runat="server">
                                 
                                    <input type="hidden" id="id" name="id" value="<?=$res['id']?>" >
                                    <div class="media_edit_area">
                                        <div id="js_appmsg_editor"><div class="appmsg_editor" style="margin-top: 0px;">
                                                <div class="inner">
                                                    
                                                <div class="inner">
                                                    <div class="appmsg_edit_item">
                                                        <label for="" class="frm_label">*标签名称</label>
                                                        <span class="frm_input_box"><input type="text" class="form-control"  name="type_name" value="<?=$res["type_name"]?>"></span>
                                                    </div>
                                                </div>
                                                </div>
                                                <i class="arrow arrow_out" style="margin-top: 0px;"></i>
                                                <i class="arrow arrow_in" style="margin-top: 0px;"></i>
                                            </div>
                                        </div>

                                    </div>
                                    <div class="line line-dashed b-b line-lg pull-in"></div>

                                    <div class="m-b-sm text-center">
                                        <button type="submit" class="btn btn-s-sm btn-success">提交</button>
                                        <button type="button" onclick="history.go(-1);" class="btn btn-s-sm btn-default">返回</button>
                                    </div>

                                </form>
                            </div>
                        </div>
                </section>
            </section>
        </section>
    </section>
</section>
<script type="text/javascript">
    function sel_data(type)
    {
        if (type == "1")
        {
            $("#content_data").show();
            $("#news_data").hide();
        } else {
            $("#content_data").hide();
            $("#news_data").show();
        }
    }

    var content_editor;
    KindEditor.ready(function (K) {
        content_editor = K.create('#ins_content');
        // content_editor.readonly(false);
    });

    KindEditor.ready(function (K) {
        var editor = K.editor({
            allowFileManager: true //允许图片管理 开启后再挑选图片的时候可以直接从图片空间内挑选
        });
        //给按钮添加click事件
        K('#insertfile').click(function () {
            editor.loadPlugin('image', function () {
                showRemote : false; //网络图片不开启
                showLocal : true;//本地图片不开启
                //图片弹窗的基本参数配置
                editor.plugin.imageDialog({
                    imageUrl: K('#url').val(), //如果图片路径框内有内容直接赋值于弹出框的图片地址文本框
                    //点击弹窗内”确定“按钮所执行的逻辑
                    clickFn: function (url, title, width, height, border, align) {
                        K('#url').val(url);//获取图片地址
                        editor.hideDialog(); //隐藏弹窗
                    }
                });
            });
        });
    });
    sel_data(1);
//		KindEditor.ready(function(K) {
//			var editor = K.editor({
//				allowFileManager : true
//			});
//
//			K('#insertfile').click(function() {
//				alert("########");
//				editor.loadPlugin('insertfile', function() {
//					editor.plugin.imageDialog({
//						fileUrl : K('#url').val(),
//						clickFn : function(url, title) {
//							alert(url+"###");
//							K('#url').val(url);
//							editor.hideDialog();
//						}
//					});
//				});
//			});
//		});

</script>
<?php include("include/footer.php"); ?>